<svg style="display: block; width: 0; height: 0">
  <defs>
    <filter id="blur">
        <feGaussianBlur id="blurElement" stdDeviation="5 0"/>
    </filter>
  </defs>
</svg>
<canvas id="canvas" width="100" height="100"></canvas>
<script>
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.font = '20px sans-serif';
ctx.filter = 'drop-shadow(0em 1em green) url(#blur)';
ctx.fillStyle = '#0f0';
ctx.fillRect(20, 20, 20, 20);
ctx.font = '30px sans-serif';
document.getElementById('blurElement').setAttribute('stdDeviation', '0, 5');
ctx.fillRect(60, 20, 20, 20);
</script>
